import request from '@/utils/request'

//post
export function postAction( url, parameter ) {
  const isRepeatSubmit = parameter.isRepeatSubmit !== false
  const isLoading = parameter.isLoading !== false

  const data = { ...parameter, isRepeatSubmit, isLoading }

  return request({
    url: url,
    method: 'post',
    data,
  })
}

//get
export function getAction( url, parameter, timeOut ) {
  if (parameter) {
    url = url + '?' + tansParams(parameter);
    url = url.slice(0, -1);
  }
  return request({
    url: url,
    method: 'get',
    timeout: timeOut ? timeOut : 15000
  })
}
